﻿app.factory('mainService', function ($resource) {
    return {
    //获取学生选中教材
        Getstu_selmater: function (data, success) {
            $resource("/api/Student/Getstu_selmater").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //插入学生选中教材
        stu_material: function (data, success) {
            $resource("/api/Student/stu_material").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //更新学生选中教材
        stu_materialupd: function (data, success) {
            $resource("/api/Student/stu_materialupd").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        	//教材
			getMaterial: function (data, success) {
                $resource("/api/Student/Getmaterial").get(data, function (res) {
                    if (success) {
                        success(res);
                    }
                }, function (res) {
                });
            },
            //章节
            getChapter: function (data, success) {
                $resource("/api/Student/Getchapter").get(data, function (res) {
                    if (success) {
                        success(res);
                    }
                }, function (res) {
                });
            }
        }
})
app.factory('passService', function ($resource) {
    return {
        //闯关列表
        Getexercises_pass: function (data, success) {
            $resource("/api/Student/Getexercises_pass").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //完成答题
        Getpassresult: function (data, success) {
            $resource("/api/Student/Getpassresult").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
    }
})
app.factory('parseService', function ($resource) {
    return {
        //解析列表
        getParseList: function (data, success) {
            $resource("/api/Student/Getstu_reason").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //插入学生习题解析结果
        Setstu_reason: function (data, success) {
            $resource("/api/Student/Setstu_reason").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //删除学生习题解析结果
        Delstu_reason: function (data, success) {
            $resource("/api/Student/Delstu_reason").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
    }
})
app.factory('errorService', function ($resource) {
    return {
        //数据
        getErrorList: function (data, success) {
            $resource("/api/Student/Getxt_error_list").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //getErrorList: function (data, success) {
        //    $resource("/modules/student/data/errordata.js").query(data, function (res) {
        //        if (success) {
        //            success(res);
        //        }
        //    }, function (res) {
        //    });
        //},
        //主观原因
        Getxt_reason: function (data, success) {
            $resource("/api/Student/Getxt_reason").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //教材
        getMaterial: function (data, success) {
            $resource("/api/Student/Getmaterial").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //试题场景
        Getexercises_place: function (data, success) {
            $resource("/api/Teacher/Getexercises_place").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //题型
        Getexercises_type: function (data, success) {
            $resource("/api/Teacher/Getexercises_type").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
        //知识点
        Getxt_error_knowledge: function (data, success) {
            $resource("/api/Student/Getxt_error_knowledge").get(data, function (res) {
                if (success) {
                    success(res);
                }
            }, function (res) {
            });
        },
    }
})


